package com.world.tg.dao;

import com.world.tg.param.AddressParam;
import com.world.tg.param.RegisterOrLoginParam;
import com.world.tg.pojo.Book;
import com.world.tg.pojo.User;
import com.world.tg.pojo.UserLogin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Date;
import java.util.List;

@Mapper
public interface UserDao {
    Integer register(RegisterOrLoginParam param);
    UserLogin login(String username);
    User findUserByName(String username);
    Integer editUser(@Param("user") User param);
    User findUserMsgById(Integer uid);
    Integer addAddress(@Param("address")AddressParam param);
    Integer addUserAddress(
            @Param("aid") Integer aid,
            @Param("uid") Integer uid,
            @Param("created")Date created,
            @Param("updated") Date updated
    );
    List<AddressParam> findAddressByUid(Integer uid);
    List<Book> findCollect(Integer uid);
    Integer getUidByUsername(String username);
    Integer editUserPhoto(
            @Param("filename") String filename,
            @Param("uid") Integer uid
    );
    String getUserPhoto(Integer uid);
}
